package edu.sctu.wangxiaoqiang.day20150508;

import edu.sctu.chengongsuo.day20150505.Person;

/**
 * Created by user25 on 2015/5/8.
 */
public class Demo1 {
    protected  String name;
    protected  int age;

    public String kind;
    static  private  int count = 0;

    public  Demo1(){
        this("未命名",0);
    }

    public Demo1(String n,int a){
        name = n;
        age = ((a>0) & (a<150))?a:0;
        count++;
    }


    void eat(){
        System.out.println("Eating...");
    }

    public void work(){
        System.out.println("Working...");
    }

    public  void setKind(String str){
        kind = str;
    }

    public String getKind(){
        return kind;
    }

    public static  int getCount(){
        return  count ;
    }

    public  void print(){
        System.out.println(name+"is"+age+"years old.");
    }

}

